Unit 17 Data Structures Resources

Demo Programs

SetDemo1 -
SetDemo2 -
SetDemo3 -
MapDemo1
-
MapDemo2 -
MapDemo3 -
MapDemo4 - building a Spanish-English dictionary from a text file (spanishenglish.txt)
MapDemo7
- avoid this Concurrent Modification Exception error when attempting to remove elements from a Map with iterators or for each loops
BinarySearchTreeWithStaticMethods
- a client program with static methods such as insertNode, findNode, nodeCount, etc.
BinarySearchTree - as a standalone class that includes helper methods

Handouts

Set & Map chart

Worksheets

Maps
map worksheet #1 - exercises with Map's
map worksheet #2 - implement add & reverse methods

Binary Trees
binary tree worksheet #1 - binary tree definitions & exercises
binary tree worksheet #2 - preorder, inorder, & postorder traversals (only available from instructor)
binary tree worksheet #3 - preorder, inorder, & postorder traversals (only available from instructor)

Binary Search Trees
binary search tree worksheet #1 - writing recursive BST methods including nodeCount, findMin, & treeSum
binary search tree worksheet #2 - writing recursive BST methods including countLeafs, treeDepth, & internalPathLength
binary search tree worksheet #3 - writing a BST method
binary search tree worksheet #4 - writing recursive BST methods including areSimilar & distance (between 2 related nodes)
binary search tree worksheet #5 - writing a recursive BST method that finds the right most leaf (only available from instructor)

Animations (some links may not work)

 

Programming Assignments

Ch. 20 Project #1 - Write a program that uses HashSets to find the union of 2 sets, the intersection of 2 sets, the difference between 2 sets, and determine whether one set is a subset of another set

Ch. 20 Project #2 - determine if a value is found anywhere in a Map.

Ch. 20 Project #3 - write a MinHeap class that implements College Board's PriorityQueue interface.

Ch. 20 Project #4 - write an AccountLookup class that uses a HashSet and a HashMap

Ch. 20 Project #5 - write a translation dictionary that uses a HashMap

Ch. 20 Project #6 - create a histogram of word frequencies with a HashMap

Ch. 20 Project #7 - implement a Priority Queue as an unordered LinkedList.

Ch. 20 Project #8 - implement a Priority Queue as an ordered ArrayList.

Ch. 20 Project #9 - implement a Priority Queue as a min-heap which in turn is based on an ArrayList.